/**
 * 
 */
package com.blumov.fastbox.infrastructure.persistence.dataaccess;

import org.hibernate.Criteria;

import com.blumov.fastbox.infrastructure.persistence.dataaccess.simpledao.SimpleDAO;

/**
 * @see CriteriaFactory
 */
public class CriteriaFactoryImpl implements CriteriaFactory {

	private SimpleDAO simpleDAO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.epidataconsulting.vonderheide.vdh.persistencia.dataaccess.criteriaFactory.CriteriaFactory
	 * #create(java.lang.Class)
	 */
	@SuppressWarnings("unchecked")
	public Criteria create(Class persistentClass) {
		return simpleDAO.createCriteria(persistentClass);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.epidataconsulting.vonderheide.vdh.persistencia.dataaccess.criteriaFactory.CriteriaFactory
	 * #create(java.lang.Class, java.lang.String)
	 */
	@SuppressWarnings("unchecked")
	public Criteria create(Class persistentClass, String alias) {
		return simpleDAO.createCriteria(persistentClass, alias);
	}

	/**
	 * Se inyecta con IoC
	 * 
	 * @param simpleDAO the simpleDAO to set
	 */
	public void setSimpleDAO(SimpleDAO simpleDAO) {
		this.simpleDAO = simpleDAO;
	}
}
